function loadInfo(){
$.ajax({
		type: "POST",
		data:postDatas,
		url: "info_VipInfo.action",
		error:function(json){
			alert( "对不起，服务器异常，请稍后再试.....");
		},
		success: function(msg){
		     infobar.html(msg);
		}
	});
}


function submitForm(){
 var postDatas = {};
    if($("#sex男").attr("checked")){
    	postDatas["sex"]='男';
    }else{
    	postDatas["sex"]='女';
    }
    var province=$("#province").val();
    var city=$("#city").val();
    if(province=='请选择'||city=='请选择'){
    	alert('对不起，所在地不能为空，请选择您的所在地！');
    	return ;
    }
    
	postDatas["province"]=province;
	postDatas["city"]=city;
	postDatas["birthd"]=$("#birthd").val();
	postDatas["blog"]=$("#blog").val();
	postDatas["email"]=$("#email").val();
	postDatas["qq"]=$("#qq").val();
	postDatas["idType"]=$("#idType").val();
	postDatas["idenficationcard"]=$("#idenficationcard").val();
	postDatas["userid"]=$("#userid").val();
	postDatas["mobile"]=$("#mobile").val();
	postDatas["address"]=$("#address").val();
	
	$.ajax({
		type: "POST",
		data:postDatas,
		url: "updateVipInfo_VipInfo.action",
		error:function(json){
			alert( "对不起，服务器异常，请稍后再试.....");
		},
		success: function(msg){
			if(msg=='error'){
				$("#msg").html("更新失败,请咨询管理人员!");
			}else{
				$("#msg").html("修改成功！");
			}
		}
	});
}
function updatePassword(){
	var vippassword=$("#vippassword").val();
	if(isNull($("#oldvippassword").val())){
		$("#msg").html("当前密码不能为空！");
		return;
	}
	if(isNull($("#vippassword1").val())){
		$("#msg").html("新密码不能为空！");
		return;
	}
	if(isNull($("#vippassword").val())){
		$("#msg").html("确认密码不能为空！");
		return;
	}
	if($("#vippassword1").val()!=$("#vippassword").val()){
		$("#msg").html("新密码和确认密码不相同！");
		return;
	}
	
	var regSymbol=/[^A-Za-z0-9_]/g
    if(regSymbol.test(vippassword)) {
    	$("#msg").html("由字母、数字、下划线组成！");
		return;
    }
    if(vippassword.length<4){
		$("#msg").html("新密码长度不能少于4位！");
		return;
	}
    
    var postDatas = {};
	postDatas["oldvippassword"]=$("#oldvippassword").val();
	postDatas["vippassword"]=$("#vippassword").val();
	$.ajax({
		type: "POST",
		data:postDatas,
		url: "todoUpdateP_VipInfo.action",
		error:function(json){
			alert( "对不起，服务器异常，请稍后再试.....");
		},
		success: function(msg){
			if(msg=='mobileError'){
				$("#msg").html("当前密码不正确，请重新输入！");
			}else{
				$("#msg").html("修改成功！");
			}
		}
	});
    
}

